package array;

/**
 * 数组反转
 */
public class ArrayReverse {

    public static void main(String[] args) {

        //要求：把数组的元素内容反转。
        int[] arr = {11,22,33,44,55,66};
        int[] arr2 = new int[arr.length];
        for (int i = 0, j = arr.length - 1; j >= 0; i++, j--) {
            arr2[j] = arr[i];
            //arr2[5] = arr[0] = 11
            //arr2[4] = arr[1] = 22
            //arr2[3] = arr[2] = 33
            //...
        }
    }
}
